//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "connection.h"
#include "unit_server.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TFormConnection *FormConnection;
//---------------------------------------------------------------------------
__fastcall TFormConnection::TFormConnection(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TFormConnection::FormShow(TObject *Sender)
{
UpdateList();
}
//---------------------------------------------------------------------------
void __fastcall TFormConnection::ListBox1DblClick(TObject *Sender)
{
int t = ListBox1->ItemIndex;
Form1->ServerSocket->Socket->Connections[t]->Close();
UpdateList();
}
//---------------------------------------------------------------------------
void __fastcall TFormConnection::UpdateList()
{
ListBox1->Clear();
for( int i=0;i<Form1->ServerSocket->Socket->ActiveConnections;++i)
    {
    if(Form1->ServerSocket->Socket->Connections[i]->Connected)
    ListBox1->Items->Add(Form1->ServerSocket->Socket->Connections[i]->RemoteAddress+
    ":"+IntToStr(Form1->ServerSocket->Socket->Connections[i]->RemotePort));
    }

}
